package cn.s1995.sloth.bizs.oo.dto;

import cn.s1995.sloth.common.core.convert.JoinUrlPrefixConvert;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * ProdictItemDTO
 *
 * @author Lex
 * @description
 * @date 2023/12/25 14:40
 */
@Data
@Schema(description = "产品项")
public class ProductItemDTO implements Serializable {
    @Schema(description = "产品ID")
    private Long prodId;

    @Schema(description = "产品名称")
    private String prodName;

    @Schema(description = "产品简介")
    private String brief;

    @Schema(description = "产品数")
    private Integer prodNum;

    @Schema(description = "产品图片")
    @JsonSerialize(using = JoinUrlPrefixConvert.class)
    private String pic;

    @Schema(description = "产品价格")
    private BigDecimal amount;

    @Schema(description = "skuId")
    private Long skuId;

    @Schema(description = "规格名称")
    private String skuName;

    @Schema(description = "规格属性")
    private String skuProperties;

    @Schema(description = "购物车id")
    private Long cartId;

    @Schema(description = "产品总金额")
    private BigDecimal totalAmount;

    @Schema(description = "产品实际金额 = 产品总金额 - 分摊的优惠金额")
    private BigDecimal actualTotal;

    @Schema(description = "满减满折优惠id，0不主动参与活动（用户没有主动参与该活动），-1主动不参与活动")
    private Long discountId = 0L;

    @Schema(description = "分摊的优惠金额")
    private BigDecimal shareReduce;

    @Schema(description = "参与满减活动列表")
    private List<cn.s1995.sloth.bizs.oo.dto.DiscountDTO> discounts = new ArrayList<>();
}
